package com.zhan.ielts.dao.impl;

import com.zhan.frame.core.dao.impl.BaseDaoImpl;
import com.zhan.ielts.dao.SpeakingRecallAttentionDao;
import com.zhan.ielts.domain.SpeakingRecall;
import com.zhan.ielts.domain.SpeakingRecallAttention;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SpeakingRecallAttentionDaoImpl extends BaseDaoImpl<SpeakingRecallAttention> implements SpeakingRecallAttentionDao {

	@Override
	public List<SpeakingRecallAttention> selectList(SpeakingRecallAttention entity) {
		return sqlSessionTemplate.selectList(getSqlName("selectByUserId"), entity.getUserId());
	}

	@Override
	public Integer queryNewCount(SpeakingRecallAttention attention) {
		return sqlSessionTemplate.selectOne(getSqlName("queryNewCount"),attention);
	}

	@Override
	public void addNewCount(SpeakingRecall attention) {
		sqlSessionTemplate.update(getSqlName("addNewCount"),attention);
	}

	@Override
	public void clearNewCount(SpeakingRecallAttention attention) {
		sqlSessionTemplate.update(getSqlName("clearNewCount"),attention);
	}

	/**
	 * 查询订阅学校的用户id
	 * @param speakingRecall
	 * @return
     */
	@Override
	public List<String> queryPushUserIdList(SpeakingRecall speakingRecall) {
		return sqlSessionTemplate.selectList(getSqlName("queryPushUserIdList"), speakingRecall);
	}


}
